/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25228
 * Date: 2024-07-27
 * Time: 15:40
 */
class Solution {
    public int removeElement(int[] nums, int val) {
        int index=0;
        int j=0;
        for (int i = 0; i < nums.length; i++) {
            if(nums[i]!=val){
                nums[j]=nums[i];
                j++;
            }
        }
        return index;
    }
}